<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JS对象_Global对象</title>

  <script>

      // Global 全局对象
      var str = "http://www.baidu.com?wd=新冠疫情";
      var encode = encodeURI(str);
      document.write(encode + "<br>");
      var decode = decodeURI(encode);
      document.write(decode + "<br>");


      var str2 = "http://www.baidu.com?wd=新冠疫情";
      var encode2 = encodeURIComponent(str2);
      document.write(encode2 + "<br>");
      var decode2 = decodeURIComponent(encode2);
      document.write(decode2 + "<br>");

      //var str3 = "123";
      //var str3 = "123abf";
      var str3 = "a123abf";
      var num = parseInt(str3);
      document.write(num + 1 + "<br>");

      //var a = "abc";
      var a = NaN;
      document.write((a == NaN) + "<br>");
      document.write(isNaN(a) + "<br>");

      var jsCode = "alert(123)";
      //alert(jsCode);
      // eval()
      eval(jsCode);

  </script>

</head>
<body>

</body>
</html>